/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 侧边栏样式 */
.sidebar {
    width: 230px;
    background-color: #f9f9f9;
    border-right: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-top: 10px;
}

.user-info {
    padding: 16px;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.new-chat-btn {
    margin: 10px 16px;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.new-chat-btn:hover {
    background-color: #f0f0f0;
}

.history-section {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px;
}

.section-title {
    font-size: 14px;
    color: #666;
    margin: 16px 0 8px 0;
}

.chat-history-item {
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 4px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    font-size: 14px;
}

.chat-history-item:hover {
    background-color: #f0f0f0;
}

/* 主聊天区域样式 */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    overflow: hidden;
}

/* 聊天消息区域 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 32px;
}

.welcome-message {
    text-align: center;
    margin: 80px auto;
    max-width: 600px;
    color: #444;
}

.welcome-message h1 {
    font-size: 24px;
    font-weight: normal;
    line-height: 1.5;
}

.message-container {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
}

.user-message {
    align-items: flex-end;
}

.ai-message {
    align-items: flex-start;
}

.message-content {
    max-width: 85%;
    border-radius: 8px;
    padding: 12px 16px;
    position: relative;
}

.user-message .message-content {
    background-color: #eaf2ff;
    color: #333;
}

.ai-message .message-content {
    background-color: #f9f9f9;
    color: #333;
}

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.bot-name {
    font-weight: bold;
    margin-left: 8px;
}

.thinking-badge {
    background-color: #e6f7ff;
    color: #1677ff;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    border: 1px solid #91caff;
}

.message-text {
    line-height: 1.6;
    word-break: break-word;
}

/* Markdown 样式 */
.message-text h1,
.message-text h2,
.message-text h3,
.message-text h4,
.message-text h5,
.message-text h6 {
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.25;
}

.message-text h1 {
    font-size: 1.5em;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
}

.message-text h2 {
    font-size: 1.3em;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
}

.message-text h3 {
    font-size: 1.2em;
}

.message-text h4 {
    font-size: 1.1em;
}

.message-text p {
    margin-top: 0;
    margin-bottom: 0.8em;
}

.message-text ul, 
.message-text ol {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    padding-left: 2em;
}

.message-text li {
    margin-bottom: 0.3em;
}

.message-text code {
    font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 3px;
}

.message-text pre {
    margin-top: 0.5em;
    margin-bottom: 1em;
    padding: 1em;
    overflow: auto;
    background-color: #f6f8fa;
    border-radius: 3px;
    font-size: 85%;
    line-height: 1.45;
    position: relative;
}

.message-text pre code {
    background-color: transparent;
    padding: 0;
    margin: 0;
    font-size: 100%;
    word-break: normal;
    white-space: pre;
    overflow: visible;
    display: block;
    width: 100%;
}

/* Add better styling for code blocks with syntax highlighting */
.message-text .hljs {
    display: block;
    overflow-x: auto;
    padding: 0.5em;
    color: #333;
    background: #f6f8fa;
    border-radius: 3px;
}

/* Ensure inline code is styled differently from code blocks */
.message-text :not(pre) > code {
    font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 3px;
    color: #d63384;
}

.message-text blockquote {
    margin: 0 0 1em;
    padding: 0 1em;
    color: #6a737d;
    border-left: 0.25em solid #dfe2e5;
}

.message-text table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1em;
}

.message-text table th,
.message-text table td {
    padding: 6px 13px;
    border: 1px solid #dfe2e5;
}

.message-text table tr {
    background-color: #fff;
    border-top: 1px solid #c6cbd1;
}

.message-text table tr:nth-child(2n) {
    background-color: #f6f8fa;
}

.message-text a {
    color: #1677ff;
    text-decoration: none;
}

.message-text a:hover {
    text-decoration: underline;
}

.message-text img {
    max-width: 100%;
    height: auto;
    margin: 0.5em 0;
}

/* 思考中动画 */
.thinking {
    padding: 16px 0;
    display: flex;
    align-items: center;
}

.dot-flashing {
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: #999;
    color: #999;
    animation: dot-flashing 1s infinite linear alternate;
    animation-delay: 0.5s;
}

.dot-flashing::before, .dot-flashing::after {
    content: '';
    display: inline-block;
    position: absolute;
    top: 0;
}

.dot-flashing::before {
    left: -15px;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: #999;
    color: #999;
    animation: dot-flashing 1s infinite alternate;
    animation-delay: 0s;
}

.dot-flashing::after {
    left: 15px;
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background-color: #999;
    color: #999;
    animation: dot-flashing 1s infinite alternate;
    animation-delay: 1s;
}

@keyframes dot-flashing {
    0% {
        background-color: #999;
    }
    50%, 100% {
        background-color: #ddd;
    }
}

/* 输入区域样式 */
.input-area {
    border-top: 1px solid #e8e8e8;
    padding: 16px 32px;
    background-color: #fff;
}

.input-container {
    display: flex;
    align-items: flex-end;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 16px;
    background-color: #fff;
}

textarea {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    padding: 8px 0;
    max-height: 150px;
    font-size: 15px;
    line-height: 1.5;
}

.send-button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1677ff;
    border: none;
    cursor: pointer;
    margin-left: 12px;
    color: white;
}

.send-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.send-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.input-footer {
    display: flex;
    margin-top: 8px;
    padding: 0 8px;
}

.input-tip {
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    margin-right: 16px;
    cursor: pointer;
    user-select: none;
}

.input-tip input[type="checkbox"] {
    margin-right: 5px;
    cursor: pointer;
}

.input-tip.active {
    color: #1677ff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .chat-messages {
        padding: 16px;
    }
    .input-area {
        padding: 12px 16px;
    }
    .message-content {
        max-width: 90%;
    }
} 